package com.xq.sboot.amqp.tut1;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Marker;
import org.slf4j.MarkerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;

/**
 * 功能说明:消息接受者类.监听队列 hello.
 * <p>创建时间: 2019-01-02 16:53</p>
 *
 * @author 郭凯强
 * @version 1.0-SNAPSHOT
 */
@RabbitListener(queues = "hello")
public class Receiver {
    private final Logger logger = LoggerFactory.getLogger(Receiver.class);
    private final Marker marker = MarkerFactory.getMarker("Receiver");

    @RabbitHandler
    public void receive(String inMessage) {
        logger.debug(marker, "{} Received {}", "[x]", inMessage);
    }
}
